//
//  MTProfile.m
//  ShiShiBang
//
//  Created by 宋宝强 on 16/9/21.
//  Copyright © 2016年 motianjituan. All rights reserved.
//

#import "MTProfile.h"
#import "UIViewController+JTNavigationExtension.h"


@interface MTProfile ()<UITextViewDelegate>
@property (weak, nonatomic) IBOutlet UITextView *textView;
@property (weak, nonatomic) IBOutlet UITextField *sexTextF;
@property (weak, nonatomic) IBOutlet UITextField *birthdayF;
@property (weak, nonatomic) IBOutlet UITextField *nickName;
@property (weak, nonatomic) IBOutlet UIImageView *headImageView;


@end
@implementation MTProfile

- (void)viewDidLoad {
    [super viewDidLoad];
    [self initNavigation];
     self.jt_fullScreenPopGestureEnabled = YES; //关闭当前控制器的全屏返回手势
//    self.sexTextF.inputView = uialer
}

//导航栏内容设置
-(void)initNavigation {
    
    self.navigationItem.title = @"个人资料";
    
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImage:[UIImage imageNamed:@"back"] highImage:[UIImage imageNamed:@"back anxia"] target:self action:@selector(backClick)];
    
    [self.navigationController.navigationBar setBackgroundImage:[UIImage imageWithColor:UIColorFromRGB(0x45c75a)]  forBarMetrics:UIBarMetricsDefault];
    NSMutableDictionary *attr = [NSMutableDictionary dictionary];
    attr[NSFontAttributeName] = [UIFont boldSystemFontOfSize:17];
    attr[NSForegroundColorAttributeName] = [UIColor whiteColor];
    [self.navigationController.navigationBar setTitleTextAttributes:attr];

    UIButton *btn = [UIButton buttonWithType:UIButtonTypeCustom];
    [btn setTitle:@"保存" forState:UIControlStateNormal];
    btn.titleLabel.font = [UIFont systemFontOfSize:14];
    [btn sizeToFit];
    [btn addTarget:self action:@selector(saveClicks) forControlEvents:UIControlEventTouchUpInside];
    self.navigationItem.rightBarButtonItem = [[UIBarButtonItem alloc] initWithCustomView:btn];
}


-(void)saveClicks {
  
// [MTHttpTools  post:MTBaseURL(@"") params:dict  success:^(id responseObj) {
//     <#code#>
// } failure:^(NSError *error) {
//     <#code#>
// }
    
}
-(void)backClick {
    [self.navigationController popViewControllerAnimated:YES];
}

#pragma mark ------点击了保存按钮
-(void)saveClick {
    [self.view endEditing:YES];
    [UIView animateWithDuration:0.1 animations:^{
        self.view.transform = CGAffineTransformMakeTranslation(0, 0);
    }];
}

- (void)touchesBegan:(NSSet<UITouch *> *)touches withEvent:(UIEvent *)event {
    [self.view endEditing:YES];
    [UIView animateWithDuration:0.1 animations:^{
        self.view.transform = CGAffineTransformMakeTranslation(0, 0);
    }];
}

- (void)textViewDidBeginEditing:(UITextView *)textView {
    //键盘高度
    [UIView animateWithDuration:0.1 animations:^{
        self.view.transform = CGAffineTransformMakeTranslation(0, -150);
    }];

}


@end
